// Date.h
// Revision date : 2007-01-14
// Revision by : Lohan, Lim / Taek han, Go (2007-01-14)
// Comment : Add Hour, Min, Second Process Logic	
//			 Taek han - set up namespace userDate

#ifndef _DATE_H
#define _DATE_H


namespace userDate {

class Date
{

public :
	typedef unsigned short int UShort;
	enum Month   { Jan=1, Feb=2, Mar=3, Apr=4, Mav=5, Jun=6, Jul=7, Aug=8, Sep=9, Oct=10, Nov=11, Dec=12 };
	enum WeekDay { Sun=0, Mon=1, Tue=2, Wen=3, Thu=4, Fri=5, Sat=6 };

public :

	// Create & Destroy //
	Date();																					// Constructor
	Date( UShort year, Month month, UShort day, UShort hour, UShort min, UShort second );	// Overloaded Constructor 01
	Date( char* date );																		// Overloaded Constructor 02
	Date( const Date& source );																// Copy Constructor	
	Date& operator=( const Date& source );													// Substitution Operator
    virtual ~Date();																		// Destructor


	//Operator Function //
	bool operator==( const Date& other );		// Operator Overloading Function...IsEqual()
	bool operator!=( const Date& other );		// Operator Overloading Function...IsNotEqual()
	
	bool operator> ( const Date& other );		// Operator Overloading Function...IsLater()
	bool operator>=( const Date& other );		// Operator Overloading Function...IsEqualLater()
	bool operator< ( const Date& other );		// Operator Overloading Function...IsEarlier()
	bool operator<=( const Date& other );		// Operator Overloading Function...IsEqualEarlier()

/*	
	Date operator+( int days );			// Operator Overloading Function...NextDays()
	Date operator-( int days );			// Operator Overloading Function...PreviousDay()
	
	Date operator++(  );				// Operator Overloading Function...tomorrow_Prefix
	Date operator++( int );				// Operator Overloading Function...tomorrow_Postfix	
	
	Date operator--(  );				// Operator Overloading Function...yesterday_Prefix
	Date operator--( int );				// Operator Overloading Function...yesterday_Postfix
*/
	
	operator char*();				// Casting Function

	//General Function //
/*	
	Date Today ();
	Date Yesterday ();
	Date Tomorrow ();
	Date PreviousDay   ( UShort days );
	Date NextDay	   ( UShort days );
*/
	Date& Update();	//new Function! 
	
	//Compare Function //
	
	bool IsEqual	   ( const Date& other );
	bool IsNotEqual    ( const Date& other );
	bool IsLater       ( const Date& other );
	bool IsEarlier     ( const Date& other );
	bool IsEqualLater  ( const Date& other );
	bool IsEqualEarlier( const Date& other );

	// Access Function //
	
	UShort  GetYear()    const;
	Month   GetMonth()   const;
	UShort  GetDay()     const;
	WeekDay GetWeekDay() const;
	UShort  GetHour()	 const;
	UShort  GetMin()	 const;
	UShort  GetSecond()  const;
//	int		GetGMT()	 const;

private :
	UShort year;
	Month  month;
	UShort day;
	WeekDay weekDay;
	UShort hour;
	UShort min;
	UShort second;
//	int	   GMT;
};


inline Date::UShort  Date::GetYear() const
{
	return this->year;
}

inline Date::Month   Date::GetMonth() const
{
	return this->month;
}

inline Date::UShort  Date::GetDay() const
{
	return this->day;
}

inline Date::WeekDay Date::GetWeekDay() const
{
	return this->weekDay;
}

inline Date::UShort Date::GetHour() const
{
	return this->hour;
}

inline Date::UShort Date::GetMin() const
{
	return this->min;
}

inline Date::UShort Date::GetSecond() const
{
	return this->second;
}
/*
inline Date::int Date::GetGMT() const
{
	return this->GMT;
}
*/

}	//end namespace userDate

#endif // _DATE_H
